Cudatashader Example¶
[1]:
from cuXfilter import charts
import cuXfilter
from bokeh import palettes
from cuXfilter.layouts import layout_2
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-77bf0aa15e91> in <module>
2 import cuXfilter
3 from bokeh import palettes
----> 4 from cuXfilter.layouts import layout_2
ImportError: cannot import name 'layout_2' from 'cuXfilter.layouts' (/home/ajay/cuXfilter-version-control/cuxfilter/python/cuXfilter/layouts/__init__.py)
Load cuXfilter dataframe¶
[2]:
cux_df1 = cuXfilter.DataFrame.from_arrow('/home/ajay/data/nyc_taxi_1.arrow')
Define Charts¶
[3]:
chart1 = charts.cudatashader.scatter_geo(x='dropoff_x',
y='dropoff_y',
aggregate_fn='count',
x_range=(-8239910.23,-8229529.24),
y_range=(4968481.34,4983152.92))
chart2 = charts.bokeh.bar('passenger_count', data_points=9)
Create dashboard¶
[4]:
d1 = cux_df1.dashboard([chart1, chart2], layout_2)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-4-c8d2871a21a3> in <module>
----> 1 d1 = cux_df1.dashboard([chart1, chart2], layout_2)
NameError: name 'layout_2' is not defined
[5]:
# d1.show('url you want the dashboard to run') remote dashboard:
# d1.app('10.110.47.43:8888') If you are using jupyter remotely, use this line instead of second, and replace url with current notebook url
#d1.app() for local interactive behavior
#d1.preview() for just a view of the dashboard, interaciton not available. Recommended way to generate when uploading to git remote site
await d1.preview()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-5-f47de8eb7080> in async-def-wrapper()
NameError: name 'd1' is not defined
Export the queried data into a dataframe¶
[6]:
queried_df = d1.export()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-6-f230250bc522> in <module>
----> 1 queried_df = d1.export()
NameError: name 'd1' is not defined